#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>

int my_strlen(char* s)
{
	int count = 0;
	while (*s != '\0')
	{
		count++;
		s++;
	}
	return count;
}

void reverse_string(char* s)
{
	if (*s == 0)
		return;
	int len = my_strlen(s);
	int tmp = s[0];
	s[0] = s[len - 1];
	s[len - 1] = '\0';
	if (my_strlen(s + 1) >= 2)
	{
		reverse_string(s + 1);
	}
	s[len - 1] = tmp;
}

int main()
{
	char arr[] = "123456";
	reverse_string(arr);
	printf("%s\n", arr);
	return 0;
}